I want to do some automatic script testing in DOORS. The idea is to have a set of test modules, on which a script under test is run and the resulting changes in the test modules are checked. After that, the changed test modules should be closed without saving to be able to run the next test on the original test modules. For each test a concatenated script is created, which contains the opening, manipulation, result checking, and closing. Manipulations are done by the script under test in both formal and link modules. All opened modules are collected in Skip lists (mapping module full name to Module object), which will be used for the closing. For closing without saving, I use the perm close(module, false). When I call it on a formal module, which references a link module, and the link module itself was also opened explicitly and was changed (e.g. link module attributes are changed), a dialog is opened, which asked to save the link module. To avoid this behavior, first I close all link modules and then close all formal modules:
Module m;
for m in openedLinkModules do {
string mName = (string key(openedLinkModules));
ModName_ ref = module(mName);
if (ref != null && open(ref) {
bool res = close(m, false);
// res is usually false, since link modules are still referenced from other formal modules
}
}
for m in openedFormalModules do {
string mName = (string key(openedFormalModules));
ModName_ ref = module(mName);
if (ref != null && open(ref) {
// closes formal module and also the referenced link modules
bool res = close(m, false);
}
}
Is this approach correct? It seems to work. But in some cases the closing of a formal module crashes DOORS. It seems to be dependent on the order the formal modules are closed: If a link source module is closed before the target module, then it seems to be OK. However, if the target module is closed first, then the later closing of the source module crashes DOORS. Additionally in one case, calling close() on a specific formal module always returns false. It is still open after that, but can be closed manually by "Manage Open Modules...". How can I find the reason for the failed closing. lastError() does not return a any error message.
UweR - Wed Apr 18 05:24:39 EDT 2018 |